package lib

import (
	"gitee.com/krio/helper/logger"
)

type Log struct {
	Level    string
	FilePath string
	Debug    bool
	TraceKey []string
}

// InitLog 初始化项目日志logger
func InitLog(l *Log) *logger.Logger {
	log := logger.NewLogger(
		logger.SetLevel(l.Level),
		logger.SetFilePath(l.FilePath),
		logger.SetDebug(l.Debug),
		logger.SetField(l.TraceKey),
	)
	logger.SetDefault(log)
	return log
}
